﻿<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="ReportLiabilities_Payment_Deadline.ascx.cs" Inherits="ERP.Modules.Report.ReportLiabilities_Payment_Deadline" %>

<%-------------------------------%>
<ext:Hidden ID="FormatTypeReportLiabilities_Payment_Deadline" runat="server" />
<ext:Panel runat="server" Layout="Fit" Border="False" ID="PanelReportLiabilities_Payment_Deadline">
    <Content>
        <%--------------GridReportLiabilities_Payment_Deadline-----------------%>
        <ext:GridPanel
            ID="grReportLiabilities_Payment_Deadline"
            Cls="grid-double"
            runat="server"
            EnableColumnMove="true"
            Border="False">
            <Store>
                <%-------------StoreReportLiabilities_Payment_Deadline-----------------%>
                <ext:Store
                    ID="StoreReportLiabilities_Payment_Deadline"
                    runat="server"
                    OnReadData="StoreReportLiabilities_Payment_Deadline_RefreshData"
                    PageSize="20">
                    <Model>
                        <ext:Model ID="ModelReportLiabilities_Payment_Deadline" runat="server">
                            <Fields>
                                <ext:ModelField Name="FullName" Type="String" />
                                <ext:ModelField Name="VoucherAmount" Type="Int" />
                                <ext:ModelField Name="Remain" Type="Int" />
                                <ext:ModelField Name="Have_Expenditure" Type="Int" />
                                <ext:ModelField Name="Payment_Deadline" Type="Date" />
                                <ext:ModelField Name="Order_Buy_Code" Type="String" />
                                <ext:ModelField Name="ReceiptReasonName" Type="String" />
                                <ext:ModelField Name="Customer_Alias" Type="String" />
                                <ext:ModelField Name="Customer_Name" Type="String" />
                            </Fields>
                        </ext:Model>
                    </Model>
                </ext:Store>
            </Store>
            <ColumnModel runat="server">
                <Columns>
                    <ext:RowNumbererColumn ID="RowNumbererColumn1" Text="STT" runat="server" Width="30" Align="Center" />
                    <ext:Column ID="Column1" runat="server" Text="Người mua" Width="130" DataIndex="FullName"/>
                    <ext:Column ID="Column2" runat="server" Text="Chứng từ" Width="100" DataIndex="Order_Buy_Code"/>
                    <ext:DateColumn ID="DateColumn1" runat="server" Text="Hạn thanh toán" Width="100" DataIndex="Payment_Deadline" Format="dd-MM-yyyy"/>
                    <ext:Column ID="Column3" runat="server" Text="Mã NCC" Width="100" DataIndex="Customer_Alias"/>
                    <ext:Column ID="Column4" runat="server" Text="Nhà cung cấp" Width="180" DataIndex="Customer_Name"/>
                    <ext:Column ID="Column5" runat="server" Text="Phải chi" Width="100" DataIndex="VoucherAmount">
                        <Renderer Handler="return indMoney(value);" />
                    </ext:Column>
                    <ext:Column ID="Column6" runat="server" Text="Đã chi" Width="100" DataIndex="Have_Expenditure">
                        <Renderer Handler="return indMoney(value);" />
                    </ext:Column>
                    <ext:Column ID="Column7" runat="server" Text="Còn lại" Width="100" DataIndex="Remain">
                        <Renderer Handler="return indMoney(value);" />
                    </ext:Column>
                    <ext:Column ID="Column8" runat="server" Text="Loại" Width="100" DataIndex="ReceiptReasonName" Flex="1"/>
                </Columns>
            </ColumnModel>
            <SelectionModel>
                <ext:CheckboxSelectionModel ID="CheckboxSelectionModelReportLiabilities_Payment_Deadline" runat="server" Mode="Multi">
                    <Listeners>
                        <SelectionChange Handler="
                            if (selected.length == 0) {
                                #{btnEdit}.disable();
                                #{btnDel}.disable();
                                #{btnExport}.disable();
                            } else {
                                #{btnEdit}.enable();
                                #{btnDel}.enable();
                                #{btnExport}.enable();
                            }" />
                    </Listeners>
                </ext:CheckboxSelectionModel>
            </SelectionModel>
            <DockedItems>
                <ext:Toolbar ID="ToolbarTopMain" runat="server" Dock="Top">
                    <Items>
                        <ext:Button ID="btnExport" runat="server" Text="Xuất tập tin" Icon="Printer">
                            <Menu>
                                <ext:Menu ID="MenuMain" runat="server">
                                    <Items>
                                        <ext:MenuItem ID="MenuItemExportXML" runat="server" Text="XML" Icon="PageCode">
                                            <Listeners>
                                                <Click Handler="submitValue(#{grReportLiabilities_Payment_Deadline}, #{FormatTypeReportLiabilities_Payment_Deadline}, 'xml');" />
                                            </Listeners>
                                        </ext:MenuItem>
                                    </Items>
                                </ext:Menu>
                            </Menu>
                        </ext:Button>

                    </Items>
                </ext:Toolbar>
                <ext:Toolbar ID="ToolbarPagging" runat="server" Dock="Bottom" AnchorHorizontal="100%">
                    <Items>
                        <ext:TriggerField ID="txtSearch" runat="server" Width="200" EnableKeyEvents="true" MarginSpec="0 8 0 0">
                            <Triggers>
                                <ext:FieldTrigger Icon="Search" />
                            </Triggers>
                            <DirectEvents>
                            </DirectEvents>
                        </ext:TriggerField>
                        <ext:PagingToolbar ID="PagingToolbarReportLiabilities_Payment_Deadline" runat="server" StoreID="StoreReportLiabilities_Payment_Deadline" BeforePageText="Trang" AfterPageText="của {0}" LastText="Cuối" NextText="Kế tiếp" PrevText="Trở lại" FirstText="Đầu" RefreshText="Làm tươi" DisplayInfo="true" DisplayMsg="Trang {0} - {1} của {2}" />
                    </Items>
                </ext:Toolbar>
            </DockedItems>
        </ext:GridPanel>
    </Content>
</ext:Panel>
